package com.atguigu.lease.web.app.custom.config;

import com.atguigu.lease.web.app.custom.Interceptor.AuthenticationInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @BelongsProject: lease
 * @BelongsPackage: com.atguigu.lease.web.app.custom.config
 * @Author: jiangyi
 * @CreateTime: 2025-08-24  15:02
 * @Description: TODO
 * @Version: 1.0
 */
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {

    @Autowired
    private AuthenticationInterceptor authenticationInterceptor;

    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authenticationInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/app/login/getCode", "/app/login");
    }

}
